ZAP Input

A Zap input is a signal that sweeps through diffrent frequencies over time

Puil et al., 1986. Quantification of membrane properties of trigemenal root ganglions in guinea pigs. J. Neurophysiol. 55, 955-1016.


In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
from math import pi as PI

def theta(t, f0, f1, dur):
    """
    f0 is the initial frequency
    f1 is the final frequency
    dur is the time it takes to sweep form f0 to f1
    t is the time that has elpased form the start to the frequency ramp
    """
    return 2*PI*t*( f0 + (f1-f0)*t/(2*dur) )

In [3]:
dt = 0.05 # 20 kHz
x = np.linspace(0,100,5000) # time

myzap = [theta(t=i,  f0=.01, f1=1, dur=100) for i in x]
y = np.sin(myzap)
plt.plot(x,y, color='#4169E1')
plt.ylim(-1.5,1.5), plt.xlim(-10,110)


Out[3]:
((-1.5, 1.5), (-10, 110))

In [ ]: